<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>async和await</title>
  </head>
  <body>
    <script src="./js/axios.js"></script>
    <script>
      //配置请求的基准地址
      axios.defaults.baseURL = "http://localhost:3000/";

      async function loadData() {
        let res = await axios.get("async");
        let result = await axios.get("async2/" + res.data);
        return result.data;
      }

      loadData().then((data) => void console.log(data));
    </script>
  </body>
</html>
